home *** CD-ROM | disk | FTP | other *** search
-
-
-
- PPPPOOOOPPPPEEEENNNN____RRRRWWWW((((3333LLLL)))) UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV ((((22229999 NNNNoooovvvveeeemmmmbbbbeeeerrrr 1111999999991111)))) PPPPOOOOPPPPEEEENNNN____RRRRWWWW((((3333LLLL))))
-
-
-
- NNNNAAAAMMMMEEEE
- popen_rw, pclose_rw - open or close pipes (for I/O) to and
- from a process
-
- SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
- ####iiiinnnncccclllluuuuddddeeee """"ppppooooppppeeeennnn....hhhh""""
-
- FFFFIIIILLLLEEEE ********ppppooooppppeeeennnn____rrrrwwww((((ccccoooonnnnsssstttt cccchhhhaaaarrrr ****ccccoooommmmmmmmaaaannnndddd))))
-
- iiiinnnntttt ppppcccclllloooosssseeee____rrrrwwww((((FFFFIIIILLLLEEEE ********ssssttttrrrreeeeaaaammmm))))
-
- DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
- The argument to ppppooooppppeeeennnn____rrrrwwww(((()))) is a pointer to a NULL-terminated
- string containing a shell command line. ppppooooppppeeeennnn____rrrrwwww(((()))) creates
- 2 pipes between the calling process and the command to be
- executed for bi-directional communication, one for reading
- from stdout and one for writing to stdin. The value
- returned is an array of 2 stream pointers such that one can
- write to the standard input of the command by writing to the
- file stream[1]; and one can read from the standard output of
- the command by reading from the file stream[0].
-
- A stream opened by ppppooooppppeeeennnn____rrrrwwww(((()))) should be closed by
- ppppcccclllloooosssseeee____rrrrwwww(((()))), which waits for the associated process to
- terminate and returns the exit status of the command.
-
- Because open files are shared the command may be used as an
- input filter, reading its standard input (which is also the
- standard output of the process doing the ppppooooppppeeeennnn____rrrrwwww) and
- providing filtered input on the stream. At the same time
- the command may be used as an output filter, reading a
- stream of output written to the stream process doing the
- ppppooooppppeeeennnn____rrrrwwww(((()))) and further filtering it and writing it to its
- standard output (which is also the standard input of the
- process doing the ppppooooppppeeeennnn____rrrrwwww).
-
- ppppooooppppeeeennnn____rrrrwwww(((()))) always calls sssshhhh(1), never ccccsssshhhh(1).
-
- SSSSEEEEEEEE AAAALLLLSSSSOOOO
- ccccsssshhhh(1), sssshhhh(1), ppppiiiippppeeee(2), wwwwaaaaiiiitttt(2), ffffcccclllloooosssseeee(3S), ffffooooppppeeeennnn(3S),
- ssssyyyysssstttteeeemmmm(3), ppppooooppppeeeennnn____iiiiooooeeee(3L)
-
- DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
- ppppooooppppeeeennnn____rrrrwwww(((()))) returns a NULL pointer if the pipe or process
- cannot be created, or if it cannot allocate as much memory
- as it needs.
-
- ppppcccclllloooosssseeee____rrrrwwww(((()))) returns -1 if stream is not associated with a
- `ppppooooppppeeeennnn____rrrrwwwwed' command.
-
- BBBBUUUUGGGGSSSS
- If the original and `ppppooooppppeeeennnn____rrrrwwwwed' processes concurrently read
-
-
-
- Page 1 (printed 12/10/91)
-
-
-
-
-
-
- PPPPOOOOPPPPEEEENNNN____RRRRWWWW((((3333LLLL)))) UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV ((((22229999 NNNNoooovvvveeeemmmmbbbbeeeerrrr 1111999999991111)))) PPPPOOOOPPPPEEEENNNN____RRRRWWWW((((3333LLLL))))
-
-
-
- or write a common file, neither should use buffered I/O,
- because the buffering gets all mixed up. Similar problems
- with an output filter may be forestalled by careful buffer
- flushing, for instance, with fffffffflllluuuusssshhhh; see ffffcccclllloooosssseeee(3S).
-
- AAAAUUUUTTTTHHHHOOOORRRR
- Kevin Russo, SFA, Inc. / US Naval Research Lab, Code 5133
- russo@orion.nrl.navy.mil
-
- Based on BSD4.3 code by Ken Arnold.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Page 2 (printed 12/10/91)
-
-
-
-